package com.student.service.impl;

import com.student.dao.StudentDao;
import com.student.entity.Student;
import com.student.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;
    //新增学生信息
    @Override
    public void addStudent(Student student) {
        studentDao.addStudent(student);
        log.info("新增学生信息成功");
    }
    //更新学生信息
    @Override
    public void updateStudent(Student student) {
        studentDao.updateStudent(student);
        log.info("更新学生信息成功");
    }
    //删除学生信息
    @Override
    public void deleteStudent(String sno) {
        studentDao.deleteStudent(sno);
        log.info("删除学生信息成功");
    }
    //查询学生信息
    @Override
    public Student getStudent(String sno) {
        Student student = studentDao.getStudent(sno);
        log.info("查询学生信息成功");
        return student;
    }
}
